/**
 * Created by Administrator on 2017/1/7.
 */
/*
	flag为true时，输入框不可用
	flag为false时，输入框可用
*/
function showModel(flag) {
    clearModal($('#myModal'),$("#delete_alert"),$(".alert_custom_common"));
    $('#myModal').modal('show');
    if(flag!=null) {
        $('#myModal input').attr("disabled", flag);
        $('#myModal select').attr("disabled", flag);
    }
    $('#myModal input').val("");
    $('#myModal select').val("");

}

function showModel2(flag) {
    clearModal($('#myModal2'),$("#delete_alert"),$(".alert_custom_common"));
    $('#myModal2').modal('show');
    if(flag!=null) {
    	$('#myModal2 input').eq(0).attr("disabled", true);
    	$('#myModal2 input').eq(1).attr("disabled", true);
    	$('#myModal2 input').eq(2).attr("disabled", flag);
    }
    $('#myModal2 input').val("");
    $('#myModal2 select').val("");
}

function  hideModel() {
    $('#myModal').modal('hide');
}

function  showAlert() {
    clearModal($("#delete_alert"),$('#myModal'),$(".alert_custom_common"));
    $("#delete_alert").slideDown();
}
function hideAlert() {
    $("#delete_alert").slideUp();
}

//导入数据按钮按钮事件
function importList() {
    clearModal($(".alert_custom_common"),$('#myModal'),$("#delete_alert"));
    $(".alert_custom_common").slideDown();
};
function importHide() {
    $(".alert_custom_common").slideUp();
}

function  clearModal(eleShow,elehide1,elehide2) {
    for(var i=0;i<arguments.length;i++){
        arguments[i].slideUp();
    }
    arguments[0].slideDown();
}

function  inputDisabled() {
    $('#myModal input').attr("disabled",true);
    $('#myModal select').attr("disabled",true);
}


$(function () {
    $('#selectAll').click(function () {
//        alert("点了");
        $('input[name=pid]').prop("checked",$(this).prop('checked'));//全选
    });
})

//============================================================================修改家长密码

function showModelPwd(flag) {
    $('#myModal1').modal('show');
}
function  hideModel1() {
    $('#myModal1').modal('hide');
}
